<?php
/**
 * Created by PhpStorm.
 * User: zhangligang
 * Date: 17/4/23
 * Time: 下午11:59
 */

namespace App\Http\Service;


use App\Http\Repository\Repository;

abstract class Service
{

    protected $repository;

    /**
     * @param Repository $repository
     */
    protected function __construct(Repository $repository)
    {
        $this->repository = $repository;
    }

    protected function getWhereClause($key, $param, $operator)
    {

        $value = $operator == 'LIKE' ? "{$param}%" : $param;

        return [

            'key' => $key,

            'operator' => $operator,

            'value' => $value
        ];

    }

}